import Vue from 'vue'
import Router from 'vue-router'
import home from './pages/home'
import index from './pages/index'
import product from './pages/product'
import detail from './pages/detail'
import cart from './pages/cart'
import order from './pages/order'
import orderconfirm from './pages/orderconfirm'
import orderlist from './pages/orderlist'
import orderpay from './pages/orderpay'
import alipay from './pages/alipay'
import prodoct from './pages/product'
import login from './pages/login'
import checkout from './pages/orderconfirm'
import seckilldetail from './pages/seckilldetail'
import seckillorder from './pages/seckillorder'
import seckillorderpay from './pages/seckillorderpay'
Vue.use(Router)

export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/',
      name: 'home',
      component: home,
      redirect: '/index',
      children: [
        {
          path: '/index',
          name: 'index',
          component: index,
        },
        {
          path: '/product/:id',
          name: 'prodoct',
          component: prodoct,
        },
        {
          path: '/detail/:id',
          name: 'detail',
          component: detail,
        },
        {
          path: '/seckilldetail',
          name: 'seckilldetail',
          component: seckilldetail,
        },
        {
          path: '/seckillorder',
          name: 'seckillorder',
          component: seckillorder,
        },
        {
          path: '/seckillorderpay',
          name: 'seckillorderpay',
          component: seckillorderpay,
        }
      ]
    },
    {
      path: '/cart',
      name: 'cart',
      component: cart
    },
    {
      path: '/checkout',
      name: 'checkout',
      component: checkout
    },
    
        {
          path: '/login',
          name: 'login',
          component: login,
        },
    {
      path: '/order',
      name: 'order',
      component: order,
      children: [
        {
          path: 'list',
          name: 'order-list',
          component: orderlist
        },
        {
          path: 'confirm',
          name: 'orderlist',
          component: orderconfirm
        },
        {
          path: 'pay',
          name: 'orderpay',
          component: orderpay
        },
        {
          path: 'alipay',
          name: 'alipay',
          component: alipay
        }
      ]
    }
  ]
})
